package com.avocado.bt.abs.decorator;

import com.avocado.bt.IBTNode;
import com.avocado.bt.abs.BaseNode;

/**
 * @Author: zsh
 * @Date: 2023/10/17 9:26
 */
public abstract class DecoratorNode extends BaseNode {

    private IBTNode child;

    public DecoratorNode(String param) {
        super(param);
    }

    @Override
    public void addChildNode(IBTNode node) {
        child = node;
    }

    public boolean hasChildNode() {
        return child != null;
    }

    public IBTNode getChildNode() {
        return child;
    }

}
